package com.winner.monitor_pattern;

/**
 * 具体事件监听器
 */
public class MonitorListenerImpl implements MonitorListener{
        @Override
        public void handleEvent(PrintEvent event) {
            event.doEvent();
            if(event.getSource().equals("openWindows")) { // 回调函数接口: handleEvent
                System.out.println("doOpen");
            }
            if(event.getSource().equals("closeWindows")){
                System.out.println("doClose");
            }
    }
}
